*------------------------------------------------------------------------------*
	*** DISTRIBUTION OF PM10 ON ELECTION DATE PLUS REFERENCE VALUES ***
*------------------------------------------------------------------------------*

*Import dataset of pollution levels one month bepfre and after election
use "${tempdata}kreise_p_w_electiondates_plusminus30days.dta", clear

*------------------------------------------------------------------------------*

*Generate average PM10 concentration by county
egen AV_PM10 = mean(PM10_ug_weight), by(kreis_code)
sum AV_PM10
local Max_PM10_Ger = r(max)

*Distribution of PM10 on election dates
kdensity PM10_ug_weight if el == 1, nograph generate(x fx)
label var x "Daily PM10 concentration ({&mu}g/m{superscript:3})"

*Graph
line fx x, sort ytitle(Density) xline(45) text(0.05 45 "WHO AQG", placement(east)) ///
	 xline(78.195) text(0.05 78.195 "China 2014-2017", placement(east)) xline(`Max_PM10_Ger') ///
	 text(0.0454 `Max_PM10_Ger' "County" "with" "highest" "daily" "average", placement(east)) ///
	 xscale(r(0 100)) graphregion(color(white))
graph export "${outputs}figure_S1a.pdf", replace

*------------------------------------------------------------------------------*
clear

exit
